package com.yequan.hbb.presenter;

import android.util.Log;

import com.yequan.hbb.entries.TuanTuanEntries;
import com.yequan.hbb.model.TuanModel;
import com.yequan.hbb.view.TuanView;

import retrofit2.Call;
import retrofit2.Response;

/**
 * Created by DingLong on 2016/10/23.
 */

public class TuanPresenter extends MVPPresenter<TuanView<TuanTuanEntries>,TuanModel> implements TuanModel.TuanCallBack {

    private TuanModel model;

    @Override
    public TuanModel createModel() {
        model = new TuanModel(this);
        return model;
    }

    public void getData() {
        model.getData();
    }
    @Override
    public void onResponse(Call<TuanTuanEntries> call, Response<TuanTuanEntries> response) {
        Log.e("自定义标签", "类名==TuanPresenter" + "方法名==onResponse=====:" + "成功");
        getView().showTuan(response.body());
    }

    @Override
    public void onFailure(Call<TuanTuanEntries> call, Throwable t) {
        Log.e("自定义标签", "类名==TuanPresenter" + "方法名==onFailure=====:" + "失败");
    }
}
